<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>算年龄</title>
    <script>
        var age1 =prompt("请输入当前年份");
        var age2 =prompt("请输入出生年份");
        alert (parseInt(age1)-parseInt(age2));
    </script>
</head>
<body>
    
</body>
</html>